package cn.hp.mapper;

import cn.hp.entity.Announcement;
import com.github.pagehelper.PageInfo;

import java.util.List;

public interface AnnouncementMapper {
    /**
     * 查询所有公告
     *
     * @return List<Announcement>
     */
    List<Announcement> selectAnnouncements(Announcement announcement);


    /**
     * 分页查询
     *
     * @param page  页
     * @param limit 条数
     * @return PageInfo<Announcement>
     */
    PageInfo<Announcement> selectAnnouncements(int page, int limit);


    /**
     * 通过id删除公告
     *
     * @param id id
     * @return int
     */
    int deleteAnnouncementById(Integer id);

    /**
     * 添加公告
     *
     * @param announcement 公告
     * @return int
     */
    int insertAnnouncement(Announcement announcement);

    /**
     * 更新公告
     *
     * @param announcement 公告
     * @return int
     */
    int updateAnnouncement(Announcement announcement);

}
